import store from '@/store'

/**
 * 判断按钮是否有权限
 *
 * @param  {...string} permissions
 * @returns
 */
export function hasPermission(...permissions) {
  const perms = new Set(store.getters.permissions)

  if (perms.has('*:*:*')) {
    return true
  }

  return permissions.some((val) => perms.has(val))
}
